/**
 * GenericComponents.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table generic_components
 * @author Viorel Tacliciu
 * @version 1
 */

@Table(name="generic_components")
@Entity
public class  GenericComponents{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps an bidirectional association

    //this attribute maps the column NAME
    private  java.lang.String  name;
    //this attribute maps the column DESCRIPTION
    private  java.lang.String  description;
    //this attribute maps the column RELATIVE_PACKAGE
    private  java.lang.String  relativePackage;
    //this attribute maps the foreign key column FK_PROJECT_LAYER
    private ProjectLayers fkProjectLayer;
    //this attribute maps the foreign key column FK_TEMPLATE
    private Template fkTemplate;
    //this attribute maps the foreign key column FK_FIXED_COMPONENT
    private FixedComponents fkFixedComponents;
      private String suffix;

    private boolean res;

    private boolean web;
    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
   
    /**
     * This method gets the name attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "NAME")
    public  java.lang.String  getName(){
        return this.name;
    }

    /**
     * The setter for NAME column
     * @param name -  an  java.lang.String  object
     **/
    public void setName( java.lang.String  name){
        this.name=name;
    }
    /**
     * This method gets the description attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "DESCRIPTION")
    public  java.lang.String  getDescription(){
        return this.description;
    }

    /**
     * The setter for DESCRIPTION column
     * @param description -  an  java.lang.String  object
     **/
    public void setDescription( java.lang.String  description){
        this.description=description;
    }
    /**
     * This method gets the relativePackage attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "RELATIVE_PACKAGE")
    public  java.lang.String  getRelativePackage(){
        return this.relativePackage;
    }

    /**
     * The setter for RELATIVE_PACKAGE column
     * @param relativePackage -  an  java.lang.String  object
     **/
    public void setRelativePackage( java.lang.String  relativePackage){
        this.relativePackage=relativePackage;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * project_layers entity
     * @return - an ProjectLayers object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT_LAYER",referencedColumnName = "ID")
    public ProjectLayers getFkProjectLayer(){
        return this.fkProjectLayer;
    }

    /**
     * This method sets the field fkProjectLayer of this entity
     * @param fkProjectLayer - an ProjectLayers object
     **/
    public void setFkProjectLayer(ProjectLayers fkProjectLayer){
        this.fkProjectLayer=fkProjectLayer;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * template entity
     * @return - an Template object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_TEMPLATE",referencedColumnName = "ID")
    public Template getFkTemplate(){
        return this.fkTemplate;
    }

    /**
     * This method sets the field fkTemplate of this entity
     * @param fkTemplate - an Template object
     **/
    public void setFkTemplate(Template fkTemplate){
        this.fkTemplate=fkTemplate;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * fixed_components entity
     * @return - an FixedComponents object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_FIXED_COMPONENT",referencedColumnName = "ID")
    public FixedComponents getFkFixedComponents() {
        return fkFixedComponents;
    }

    public void setFkFixedComponents(FixedComponents fixedComponents) {
        this.fkFixedComponents = fixedComponents;
    }
    /**
     * This method gets the suffix attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "SUFFIX")
    public  java.lang.String  getSuffix(){
        return this.suffix;
    }

    /**
     * The setter for SUFFIX column
     * @param suffix -  an  java.lang.String  object
     **/
    public void setSuffix( java.lang.String  suffix){
        this.suffix=suffix;
    }
    /**
     * This method gets the isRes attribute
     * @return - an  java.lang.Integer  object
     **/
     @Column(name="IS_RES")
    public boolean isRes() {
        return res;
    }

    public void setRes(boolean res) {
        this.res = res;
    }
    @Column(name="IS_WEB")
    public boolean isWeb() {
        return web;
    }

    public void setWeb(boolean web) {
        this.web = web;
    }
}



